/*  File Name	: SandBoxMonitor.h
 *  Author		: Javie Pong
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-10-31
 *  Description:
 */

#ifndef SANDBOXMONITOR_H_
#define SANDBOXMONITOR_H_
#include "Monitor.h"
#include "SandBoxService.h"
#include "MonitorSock.h"

class SandBoxMonitor:public Monitor<SandBoxService>
{
public:
	typedef MonitorAcceptor<SandBoxMonitor,SandBoxService> SandBoxAcceptor;

	virtual ~SandBoxMonitor();

	static SandBoxMonitor *instance(void);

	virtual int init(int line_id,int list_size=10240,int block_size=4096,int pool_size=10240,
			int growth_size=1024,std::string pool_name="SandBoxMonitor-Msg");

	virtual int start(void);

	virtual int stop(void);

	virtual int run_request_loop(void);

	virtual int run_respond_loop(void);

	void collection_info(void);

private:
	typedef Monitor<SandBoxService> super;

private:
	SandBoxMonitor();

	static SandBoxMonitor *instance_;
	SandBoxAcceptor *acceptor_;
};

#endif /* SANDBOXMONITOR_H_ */
